import { createRouter, createWebHistory } from 'vue-router'

import AddBookView from "@/Views/addBook/index.vue";
import LayoutView from "@/Views/Layout/index.vue";
import LoginView from "@/Views/Login/index.vue";
import updateView from "@/Views/updateBopk/index.vue";
import queryView from "@/Views/queryBook/index.vue";
import IndexView from "@/Views/index/index.vue";
import UserView from "@/Views/User/index.vue";
import SystemView from "@/Views/System/index.vue";
import perView from "@/Views/personage/index.vue";
import returnView from "@/Views/returnBook/index.vue";
import borrowView from "@/Views/borrowBook/index.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:"/",
      name:"",
      component:LayoutView,
      redirect:"/index",
      children:[
        {path:"index",name:"index",component:IndexView},
        {path:"addBook",name:"addBook",component:AddBookView},
        {path:"query",name:"query",component:queryView},
        {path:"update",name:"update",component:updateView},
        {path:"user",name:"user",component:UserView},
        {path:"system",name:"system",component:SystemView},
        {path:"personage",name:"personage",component:perView},
        {path:"returnBook",name:"returnBook",component:returnView},
        {path:"borrowBook",name:"borrowBook",component:borrowView},
      ]
    },
    {path:"/login",name:"login",component:LoginView},
  ],
});

export default router
